package wec_wallet.ebo.com.util;

/**
 * Created by Administrator on 2018/4/4.
 */

import android.content.Context;

import java.math.BigDecimal;
import java.text.DecimalFormat;

/**
 * 转出金额转换与运算
 */
public class ChangeUtil {
    public static double getCny(double num, double rate) {
        return num * rate;
    }

    public static double getTax(double num, double rate, double low) {

        return Math.max(low, num * rate);
    }

    public static String m2(double f) {
        DecimalFormat df = new DecimalFormat("#0.00#####");
        return df.format(f);
    }
    public static String m3(double f) {
        DecimalFormat df = new DecimalFormat("#0.00########");
        BigDecimal bd1 = new BigDecimal(f);
        return df.format(bd1);
    }
    public static int dip2px(Context var0, float var1) {
        float var2 = var0.getResources().getDisplayMetrics().density;
        return (int)(var1 * var2 + 0.5F);
    }


}
